import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:fluttertoast/fluttertoast.dart';

class Config{
   //项目配置信息
   static const String DOMAIN="http://192.168.1.22:8000/api";
   static const String WEBSOCKET_URL="ws://192.168.1.22:8002";
   static const String LOGO="https://t2app.oss-cn-chengdu.aliyuncs.com/LOGO.png";
   static const String LOGO_LOCAL="assets/images/logo.png";

   //微信配置信息
   static const Map<String, String> WEI_XIN = {
      "appId": "wx7e0b20062e33d889",
      "universalLink":"https://www.t2app.com",
   };


   static final  ThemeData THEME= new ThemeData(
      primaryColor: Colors.blueAccent,
      primaryColorLight: Colors.lightBlue[200],
      primaryColorDark: Colors.blueGrey[800]
   );

   /**
    * 顶部bar
    */
   static AppBar APP_BAR ({Widget? title}) {
      AppBar appBar = new AppBar(
         title: title??new Text("软件万事屋"),
         backgroundColor: THEME.primaryColorLight,
      );
      return appBar;
   }

   static void initConfigEasyLoading(){
      EasyLoading.instance
         ..displayDuration = const Duration(milliseconds: 2000)
         ..indicatorType = EasyLoadingIndicatorType.fadingCircle
         ..loadingStyle = EasyLoadingStyle.custom
         ..indicatorSize = 45.0
         ..radius = 10.0
         ..progressColor =THEME.primaryColor
         ..backgroundColor = Colors.white.withValues(alpha:0.9)
         ..indicatorColor = THEME.primaryColor
         ..textColor =THEME.primaryColor
         ..maskColor = Colors.white.withValues(alpha:0.4)
         ..maskType = EasyLoadingMaskType.clear
         ..userInteractions=false
         ..dismissOnTap = false;
      }

}